for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import Backbone from 'backbone';
import _ from 'underscore';
import {
Backgrid
} from './core.js';
/**
EmptyRow is a simple container view that takes a list of column and render a
row with a single column.
@class Backgrid.EmptyRow
@extends Backbone.View
*/
var EmptyRow = Backbone.View.extend({
/** @property */
tagName: "tr",
/** @property {string|function(): string} */
emptyText: null,
Initializer.
@param {Object} options
@param {string|function(): string} options.emptyText
@param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns Column metadata.
initialize: function (options) {
this.emptyText = options.emptyText;
this.columns = options.columns;
},
Renders an empty row.
render: function () {
this.$el.empty();
var td = document.createElement("td");
td.setAttribute("colspan", this.columns.length);
var span = document.createElement("span");
span.innerHTML = _.result(this, "emptyText");
td.appendChild(span);
this.el.className = "empty";
this.el.appendChild(td);
return this;
}
});
export {
EmptyRow
};